package a03Leidemo3;

import java.util.ArrayList;
import java.util.Collections;
import java.util.function.Predicate;

public class Test1 {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>();
        Collections.addAll(list, "abc", "acc", "bac", "ac");
//
//        list.stream()
//                .filter(new Predicate<String>() {
//                    @Override
//                    public boolean test(String s) {
//                        return false;
//                    }
//                }).forEach(s-> System.out.println(s));

//     1   list.stream()
//                .filter(new method()::stringJudge)
//                .forEach(s -> System.out.println(s));


        method me = new method();
        list.stream()
                .filter(me::stringJudge)
                .forEach(s -> System.out.println(s));
    }
}
//class method{
//    public boolean stringJudge(String s) {
//       return s.startsWith("a") && s.length() == 3;
//    }
//}